package com.feign;

import com.feign.hystrix.UserInfoFeignHystrix;
import com.util.JsonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "member-server", fallback = UserInfoFeignHystrix.class)
public interface UserInfoFeignApi {
    @GetMapping("/users/get")
    JsonResult get(@RequestParam("id") String id);
    //若参数为对象，使用
    //UserInfo get(@RequestBody UserInfo user);

    @GetMapping("/users/checkPhone")
    JsonResult checkPhone(@RequestParam("phone")String phone);
    @GetMapping("/users/regist")
    JsonResult regist(@RequestParam(value="phone",required = false) String phone, @RequestParam(value="nickname",required = false) String nickname,
                      @RequestParam(value="password",required = false) String password, @RequestParam(value="rpassword",required = false)String rpassword);
}